import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:lcapp/config/const_config.dart';
import 'package:lcapp/routes/route.dart';
// import 'package:umeng_verify_sdk/umeng_verify_sdk.dart';

class LoginUtil {
  static bool canLogin = false;
  static login()async{
    // UmengVerifySdk.debugLoginUIWithController();
    SmartDialog.dismiss();
    // if(Platform.isIOS){
    //   Map res = await UmengVerifySdk.checkEnvAvailableWithAuthType_ios('TVbVmXnYky40OZ2NXK5S4pDJ5F0KUBtTgVq8tGe+5iJ2frSdzJFE6Y6VlNtnjXmjWieT3irWeeGgTklAWgnrcZIJhx4l6dalB/hL7hp0bpe3ZIRmQzq6L2pbaGRcghZCMkbAkbxj7knkDrRuyrEUZFzt4qP3uZnC4bm0wQqeoFX3deOtMzVJJtPCpYly9UmPPZ3Xq5W3TLmAN56NWv7sbunA4byZM40YaNuHJR7ZMid2oGyi9f8Hoh9nZ5ONC5tE4Zc2k+AFrtI=');
    //   if(res['resultCode'] == '600000'){
    //     LoginUtil.canLogin = true;
    //   }
    //   // showToast(res.toString());
    // }else{
    //   UmengVerifySdk.checkEnvAvailable_android(UMEnvCheckType.type_login);
    // }
    if(canLogin==false){
      Navigator.of(ASRRoute.navigatorKey.currentContext!).pushNamed("LoginPage");
      return;
    }
    // UMCustomModel model = UMCustomModel();
    // model.logoImage = 'icon';
    // model.navColor = 0xffFCFCFC;
    // model.checkBoxIsChecked = false;
    // model.navTitle = ['一键登录',0XFF000000,26];
    // model.loginBtnBgImgs_ios = ['login_bg_img','login_bg_img','login_bg_img'];
    // model.loginBtnBgImg_android = 'login_bg_img';
    // model.privacyPreText = '登录注册即同意';
    // model.privacyOne = ['用户协议',protocolURL];
    // model.privacyTwo = ['隐私协议',privacyURL];
    // model.privacyOperatorIndex = 3;
    // model.privacyConectTexts = ['和','及'];
    // model.navTitle = ['',0,0];
    // UmengVerifySdk.getLoginTokenWithTimeout(5, model);
  }
}